﻿
/*----------------------------------------------------------------//
// 文件名：MoNoticeReceiver.cs
// 文件功能描述：实体 MoNoticeReceiver.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoNoticeReceiver
using System;
using System.Data;
namespace EQT.Model
{
    /// <summary>
    /// 业务实体MoNoticeReceiver
    /// </summary>
    public partial class MoNoticeReceiver : ICloneable
    {
        #region 表NoticeReceiver的字段
        private int recId;
        private string uid;
        private string noticeId;
        private int recStatus;
        private DateTime recTime;
        #endregion

        #region 构造函数
        public MoNoticeReceiver()
        {
            recTime = new DateTime(1900, 1, 1);

        }
        #endregion

        #region 拷贝构造函数

        public MoNoticeReceiver(MoNoticeReceiver item)
        {
            item.CopyTo(this);
        }
        #endregion

        #region 带参数构造函数
        public MoNoticeReceiver(int recId, string uid, string noticeId, int recStatus, DateTime recTime)
        {
            this.recId = recId;
            this.uid = uid;
            this.noticeId = noticeId;
            this.recStatus = recStatus;
            this.recTime = recTime;
        }
        #endregion

        #region 表NoticeReceiver的字段属性
        /// <summary>
        /// REC_ID
        /// </summary>
        public int RecId
        {
            get { return recId; }
            set { recId = value; }
        }
        /// <summary>
        /// UID
        /// </summary>
        public string Uid
        {
            get { return uid; }
            set { uid = value; }
        }
        /// <summary>
        ///使用GUID实现；
        /// </summary>
        public string NoticeId
        {
            get { return noticeId; }
            set { noticeId = value; }
        }
        /// <summary>
        ///0=发布未读，1=已读 ，2=已删除
        /// </summary>
        public int RecStatus
        {
            get { return recStatus; }
            set { recStatus = value; }
        }
        /// <summary>
        /// REC_TIME
        /// </summary>
        public DateTime RecTime
        {
            get { return recTime; }
            set { recTime = value; }
        }
        #endregion

        #region 辅助函数
        /// <summary>
        /// 拷贝函数
        /// </summary>
        public MoNoticeReceiver CopyTo(MoNoticeReceiver item)
        {
            item.recId = this.recId;
            item.uid = this.uid;
            item.noticeId = this.noticeId;
            item.recStatus = this.recStatus;
            item.recTime = this.recTime;
            return item;
        }
        /// <summary>
        /// 克隆函数
        /// </summary>		
        public object Clone()
        {
            MoNoticeReceiver mo = new MoNoticeReceiver();
            mo.RecId = this.RecId;
            mo.Uid = this.Uid;
            mo.NoticeId = this.NoticeId;
            mo.RecStatus = this.RecStatus;
            mo.RecTime = this.RecTime;
            return mo;
        }
        ///<summary>
        ///判断对象是否相等
        ///<summary>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            else
            {
                MoNoticeReceiver NewNoticeReceiver = obj as MoNoticeReceiver;
                if (NewNoticeReceiver == null)
                {
                    return false;
                }
                else
                {
                    if (NewNoticeReceiver.RecId == this.RecId && NewNoticeReceiver.Uid == this.Uid && NewNoticeReceiver.NoticeId == this.NoticeId && NewNoticeReceiver.RecStatus == this.RecStatus && NewNoticeReceiver.RecTime == this.RecTime)
                    {
                        return true;
                    }
                }

            }
            return false;

        }
        ///TODO:you should modify GetHashCode by yourself.
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format(System.Globalization.CultureInfo.InvariantCulture, "RecId={0}/Uid={1}/NoticeId={2}/RecStatus={3}/RecTime={4}", recId, uid, noticeId, recStatus, recTime);

        }
        #endregion


        #region DataTable Help Function
        ///<summary>
        ///DataRow转换成Model
        ///</summary>
        public void Row2Model(DataRow row)
        {
            if (row["Rec_ID"] != null && row["Rec_ID"] != DBNull.Value)
            {
                this.RecId = (int)row["Rec_ID"];
            }
            else
            {
                this.RecId = 0;
            }
            if (row["UID"] != null && row["UID"] != DBNull.Value)
            {
                this.Uid = (string)row["UID"];
            }
            else
            {
                this.Uid = string.Empty;
            }
            if (row["Notice_ID"] != null && row["Notice_ID"] != DBNull.Value)
            {
                this.NoticeId = (string)row["Notice_ID"];
            }
            else
            {
                this.NoticeId = string.Empty;
            }
            if (row["Rec_Status"] != null && row["Rec_Status"] != DBNull.Value)
            {
                this.RecStatus = (int)row["Rec_Status"];
            }
            else
            {
                this.RecStatus = 0;
            }
            if (row["Rec_Time"] != null && row["Rec_Time"] != DBNull.Value)
            {
                this.RecTime = (DateTime)row["Rec_Time"];
            }
            else
            {
                this.RecTime = DateTime.MinValue;
            }
        }

        ///<summary>
        ///Model转换成DataRow
        ///</summary>
        public void Model2Row(DataRow row)
        {
            row["Rec_ID"] = this.RecId;
            row["UID"] = this.Uid;
            row["Notice_ID"] = this.NoticeId;
            row["Rec_Status"] = this.RecStatus;
            row["Rec_Time"] = this.RecTime;
        }
        #endregion
    }
}
#endregion
